﻿Imports System.Data
Imports VSModel
Imports Cls_Common
Imports SecurityService
Partial Class Control_MSDS_Section10View
    Inherits System.Web.UI.UserControl
#Region "EVENT FOR CONTROL"

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Me.EnableViewState = False
            If Not Request.QueryString("Id").ToString.Equals("0") Then
                hidMSDSID.Value = Request.QueryString("Id")
            End If
            Translate()
            CheckData()
        End If
    End Sub
    Protected Sub Translate()
        lblSection10Title.Text = getTranslate("lblSection10Title", Session("LanguageId"), lblSection10Title.Text)
        lbSection10lbStabilize.Text = getTranslate("lbSection10lbStabilize", Session("LanguageId"), lbSection10lbStabilize.Text)
        lbSection10lbReactivityr.Text = getTranslate("lbSection10lbReactivityr", Session("LanguageId"), lbSection10lbReactivityr.Text)
    End Sub
    
#End Region
#Region "PRIAVTE SUB AND FUNCTION"
    Sub CheckData()
        Using data As New VSEntities
            Dim LanguageId = Session("LanguageId").ToString()
            Dim p = (From q In data.MSDSSection10
               Where q.LanguageId = LanguageId And q.MSDSId = hidMSDSID.Value
               ).FirstOrDefault()
            If Not p Is Nothing Then
                txtS1011.Text = p.S1011
                txtS1021.Text = p.S1021
                hidID.Value = p.Section10Id
            End If
        End Using
    End Sub
#End Region
End Class
